﻿using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation.Regions;

namespace L6_RegionNavigation.ViewModels
{
    public class MainWindowViewModel : BindableBase
    {
        private readonly IRegionManager regionManager;

        public DelegateCommand<string> ViewChangeCommand { get; set; }

        public MainWindowViewModel(IRegionManager regionManager)
        {
            this.regionManager = regionManager;

            ViewChangeCommand = new DelegateCommand<string>(ExcuteViewChangeCommand);
        }

        private void ExcuteViewChangeCommand(string view)
        {
            this.regionManager.RequestNavigate("ContentRegion", view);
        }
    }
}